package io.openkunlun.javadsl.springboot.server;

import io.openkunlun.javadsl.DaprExceptionResolver;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Role;

@Configuration
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public class DaprResolverRegistrar {

    @Bean(name = "daprExceptionResolver")
    @ConditionalOnMissingBean
    DaprExceptionResolver resolver() {
        return DaprExceptionResolver.DEFAULT;
    }
}
